logical programming in c